<?php 
require_once 'Lib/main.php';
$codeControlDao =  new Dao_CodeControlDAO();
$isDisplayFace = $codeControlDao->getValueByCode('SHARE_DIS_01');
$isDisplayTwitter = $codeControlDao->getValueByCode('SHARE_DIS_02');
$isDisplayGplus = $codeControlDao->getValueByCode('SHARE_DIS_03');

if ($isDisplayFace === null) {
	$isDisplayFace = '0';
}

if ($isDisplayTwitter === null) {
	$isDisplayTwitter = '0';
}

if ($isDisplayGplus === null) {
	$isDisplayGplus = '0';
}
?>

<div class="box">
	<div class="title">
		<h2>Chia sẻ</h2>
		<img class="bullet" src="css/images/bullet.png"
			alt="small grey bullet" />
	</div>

	<ul class="social">
		<?php if ($isDisplayFace == '1') { 
			$nameFace = $codeControlDao->getValueByCode('SHARE_01');
			
			if ($nameFace === null) {
				$nameFace = '';
			}
		?>
			<li><a title="Facebook"
				href="javascript:shareOnFacebook(location.href)"> <img
					src="css/images/fb.png" alt="facebook icon" /> <?php echo $nameFace; ?>
			</a></li>
		<?php } ?>
			
		<?php if ($isDisplayTwitter == '1') { 
			$nameTwitter = $codeControlDao->getValueByCode('SHARE_02');
			
			if ($nameTwitter === null) {
				$nameTwitter = '';
			}
		?>
		<li><a title="Tweeter" href="javascript:shareOnTwitter(location.href)">
				<img src="css/images/tweet.png" alt="tweeter icon" /> Twitter
		</a></li>
		<?php } ?>
		
		<?php if ($isDisplayGplus == '1') { 
			$nameGplus = $codeControlDao->getValueByCode('SHARE_03');
			
			if ($nameGplus === null) {
				$nameGplus = '';
			}
		?>
		<li><a title="Google Plus"
			href="javascript:shareOnPlusone(location.href)"> <img
				src="css/images/plusone.png" alt="plusone icon" /> Google Plus
		</a></li>
		<?php } ?>
		<!--
<li><a title="Digg" href="#"><img src="css/images/digg.png" alt="digg icon" />digg</a></li>
-->
	</ul>
</div>